#ifndef FILELIST_H_
#define FILELIST_H_

#include "../common/common.h"

typedef struct _file_t{
	u_char *name;
	u_char *key;
	u_int size;
	//addr_t *addr;
}file_t;

typedef file_t * file_p;

typedef struct element{
	file_p data;
	struct element *next;
	struct element *previous;
}element;


typedef struct filelist{
	element *first;
	element *last;
	u_int size;
}filelist_t;

typedef filelist_t * filelist_p;

filelist_p flist_new(void);
void flist_init(filelist_p list);
return_t flist_insert(filelist_p list, file_p datafile);
return_t flist_remove(filelist_p list, file_p datafile);
return_t flist_clear(filelist_p list);
void flist_delete(filelist_p list);
void flist_print(filelist_p list);
file_t * findElementByKey(filelist_t * list,u_char * key);
#endif /* FILELIST_H_ */
